package com.surprise.es;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;

import com.surprise.base.BaseBeanConfig;

/**
 * ESBeanConfig.java
 * @author nick
 * 2015年3月9日
 */
@Configuration
@ComponentScan(basePackages = "com.surprise.es",
        excludeFilters = @Filter(type = FilterType.REGEX, pattern = {
                "com.surprise.es.util", "com.surprise.es.po",
                "com.surprise.es.bo" }))
@Import(BaseBeanConfig.class)
@PropertySource({"classpath:/common-es.properties"})
public class ESBeanConfig {
    @Bean
    public static PropertySourcesPlaceholderConfigurer propertyConfigurer8() {
        PropertySourcesPlaceholderConfigurer order = new PropertySourcesPlaceholderConfigurer();
        order.setOrder(8);
        order.setIgnoreUnresolvablePlaceholders(true);
        return order;
    }
}
